package com.itjeffrey.autocode.bo.req;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @From: Jeffrey
 * @Date: 2020/12/21
 */
@ApiModel(value = "RegisterBO", description = "用户注册BO")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RegisterBO implements Serializable {
    private static final long serialVersionUID = -5899386414851384611L;

    @ApiModelProperty(name = "loginname", value = "账号", dataType = "string", required = true)
    @NotNull(message = "账号不允许为空！")
    private String loginname;

    @ApiModelProperty(name = "loginpwd", value = "密码", dataType = "string", required = true)
    @NotNull(message = "密码不允许为空！")
    private String loginpwd;

    @ApiModelProperty(name = "username", value = "用户名", dataType = "string", required = true)
    @NotNull(message = "用户名不允许为空！")
    private String username;

    @ApiModelProperty(name = "nickname", value = "昵称", dataType = "string")
    private String nickname;

    @ApiModelProperty(name = "birthday", value = "生日", dataType = "date")
    private Date birthday;

    @ApiModelProperty(name = "email", value = "邮箱", dataType = "string")
    private String email;

    @ApiModelProperty(name = "phone", value = "手机号", dataType = "string")
    private String phone;

    @ApiModelProperty(name = "address", value = "地址", dataType = "string")
    private String address;

    /**
     * jackson默认行为, swagger在生成接口规范时，会强制按照内部限定的驼峰命名规范来转换后台定义的model属性名显示。
     *
     * 例如属性中定义了String AAA_BBB，swagger传递参数时变为aaa_BBB。
     * 默认情况下类的成员变量以小写字母开头, 当需要以大写开头时,系统在编译时或者swagger在传递参数时都会自动将大写变为小写,带来一些不便
     * 解决方法：
     * 1.在声明变量时加上注解：@JsonProperty(value="AAA_BBB")
     */
    @JsonProperty("TEST_PROP")
    @ApiModelProperty(value = "测试全大写字段", dataType = "string")
    private String TEST_PROP;

}
